package com.dong.mcd.page;

public class OracleDialect extends Dialect{

	@Override
	public String getLimitString(String sql, int offset, int limit) {

		sql = sql.trim();
		StringBuffer pagingSelect = new StringBuffer(sql.length() + 100);
		
		pagingSelect.append("select AAA.* from ( select row_.*, rownum rownum_ from ( ");
		
		pagingSelect.append(sql);
		
		pagingSelect.append(" ) row_ ) AAA where rownum_ > ").append(offset).append(" and rownum_ <= ").append(offset + limit);
		
		return pagingSelect.toString();
	}

}